#include<bits/stdc++.h>
using namespace std;
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
const int N=2e5+5;
typedef vector<int> vi; 
#define pb push_back
typedef long long ll;
typedef long double ld; 
typedef vector<int>  vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int main()
{
    int n,a,x,y;
    cin>>n>>a>>x>>y;
    if(n>a){
        cout<<a*x+(n-a)*y;
    }
    else
        cout<<n*x;
}